Declarative Management of Kubernetes Objects Using Kustomize | 您所在的位置:网站首页 › kubectl apply › Declarative Management of Kubernetes Objects Using Kustomize |
Declarative Management of Kubernetes Objects Using Kustomize Kustomize is a standalone tool to customize Kubernetes objects through a kustomization file. Since 1.14, Kubectl also supports the management of Kubernetes objects using a kustomization file. To view Resources found in a directory containing a kustomization file, run the following command: kubectl kustomizeTo apply those Resources, run kubectl apply with --kustomize or -k flag: kubectl apply -k Before you beginInstall kubectl. You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds: KillercodaPlay with KubernetesTo check the version, enter kubectl version.Overview of KustomizeKustomize is a tool for customizing Kubernetes configurations. It has the following features to manage application configuration files: generating resources from other sourcessetting cross-cutting fields for resourcescomposing and customizing collections of resourcesGenerating ResourcesConfigMaps and Secrets hold configuration or sensitive data that are used by other Kubernetes objects, such as Pods. The source of truth of ConfigMaps or Secrets are usually external to a cluster, such as a .properties file or an SSH keyfile. Kustomize has secretGenerator and configMapGenerator, which generate Secret and ConfigMap from files or literals. configMapGeneratorTo generate a ConfigMap from a file, add an entry to the files list in configMapGenerator. Here is an example of generating a ConfigMap with a data item from a .properties file: # Create a application.properties file cat |
CopyRight 2018-2019 实验室设备网 版权所有 |